package cn.cloudreal.cbms.castDetail.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import cn.cloudreal.cbms.castDetail.dao.CastDetailDao;
import cn.cloudreal.cbms.castDetail.service.CastDetailService;
import cn.cloudreal.cbms.common.util.PageBean;
import cn.cloudreal.cbms.vo.CastDetail;
import cn.cloudreal.cbms.vo.Material;
import cn.cloudreal.cbms.vo.MediaPrice;
import cn.cloudreal.cbms.vo.Mediasumm;
import cn.cloudreal.cbms.vo.Medium;
import cn.cloudreal.cbms.vo.Project;
import cn.cloudreal.cbms.vo.ProjectMedium;
import cn.cloudreal.cbms.vo.QueryArrangement;

/**
 * <p>
 * Title: CBM
 * </p>
 * <p>
 * Description:投放明细Service层实现类
 * </p>
 * <p>
 * Copyright: Copyright (c) 2012
 * </p>
 * <p>
 * Company:云恒瑞通
 * </p>
 * 
 * @author WangTao
 * @date 2012-07-09
 */
public class CastDetailServiceImpl implements CastDetailService
{
    /** 日志工具类实例 */
    private static final Logger log = Logger.getLogger(CastDetailServiceImpl.class);

    /** 服务 */
    CastDetailDao castDetailDao;

    public void setCastDetailDao(CastDetailDao castDetailDao)
    {
        this.castDetailDao = castDetailDao;
    }
    
    /**
     * 获取投放明细count
     * @return int
     */
    public int getCastDetailCount(Map condition)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getCastDetailCount(condition);
    }
    
    /**
     * 获取媒介投放明细列表
     * 
     * @return List<CastDetail>
     */
    public List<CastDetail> getMediumCastDetailList(Map condition, PageBean page)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getMediumCastDetailList(condition, page);
    }
    
    /**
     * 获取项目投放明细列表
     * 
     * @return List<CastDetail>
     */
    public List<CastDetail> getProjectCastDetailList(Map condition,
            PageBean page)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getProjectCastDetailList(condition, page);
    }
    
    /**
     * 删除投放明细
     * 
     * @return void
     */
    public boolean deleteCastDetail(ProjectMedium pm, Medium m)
    {
        // TODO Auto-generated method stub
        return castDetailDao.deleteCastDetail(pm, m);
    }

    /**
     * 插入
     * 
     * @return int
     */
    public int insertBasicInfo(ProjectMedium projectMedium)
    {
        // TODO Auto-generated method stub
        return castDetailDao.insertBasicInfo(projectMedium);
    }

    /**
     * 媒体查询
     * 
     * @return List<Mediasumm>
     */
    public List<Mediasumm> ajaxGetMedia(MediaPrice mediaPrice)
    {
        // TODO Auto-generated method stub
        return castDetailDao.ajaxGetMedia(mediaPrice);
    }

    /**
     * 媒介查询
     * 
     * @return List<Medium>
     */
    public List<Medium> ajaxGetMedium(Medium medium)
    {
        // TODO Auto-generated method stub
        return castDetailDao.ajaxGetMedium(medium);
    }

    /**
     * 项目查询
     * 
     * @return List<Project>
     */
    public List<Project> ajaxGetProject(Project project)
    {
        // TODO Auto-generated method stub
        return castDetailDao.ajaxGetProject(project);
    }
    
    /**
     * 插入
     * 
     * @return void
     */
	public void insertMaterialInfo(ProjectMedium projectMedium) {
		// TODO Auto-generated method stub
		castDetailDao.insertMaterialInfo(projectMedium);
	}
	
    /**
     * 物料查询
     * 
     * @return List<Material>
     */
	public List<Material> ajaxGetMaterial(Material material) {
		// TODO Auto-generated method stub
		return castDetailDao.ajaxGetMaterial(material);
	}

    public Medium getMediumByMediumID(int mediumID)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getMediumByMediumID(mediumID);
    }

    public Project getProjectByProjectID(String projectID)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getProjectByProjectID(projectID);
    }

    public ProjectMedium getProjectMediumByProMedID(int proMedID)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getProjectMediumByProMedID(proMedID);
    }

    public boolean updateAllArrangement(String[] totalMediumArrangement,
            ProjectMedium pm, Medium m)
    {
        // TODO Auto-generated method stub
        return castDetailDao.updateAllArrangement(totalMediumArrangement, pm, m);
    }

    public CastDetail getMediumCastDetail(ProjectMedium projectMedium)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getMediumCastDetail(projectMedium);
    }

    public int updateMediumCastDetail(CastDetail castDetail, int flag)
    {
        // TODO Auto-generated method stub
        return castDetailDao.updateMediumCastDetail(castDetail, flag);
    }

    public List<QueryArrangement> queryArrangement(Map condition,
            PageBean page)
    {
        // TODO Auto-generated method stub
        return castDetailDao.queryArrangement(condition, page);
    }

    public int queryArrangementCount(Map condition)
    {
        // TODO Auto-generated method stub
        return castDetailDao.queryArrangementCount(condition);
    }

    public List<String> getMediumByField(Map condition)
    {
        // TODO Auto-generated method stub
        return castDetailDao.getMediumByField(condition);
    }

}
